package com.dream.technology.controller;

import com.dream.technology.db.entity.RcDateType;
import com.dream.technology.data.GenericRspDTO;
import com.dream.technology.service.RcDateTypeService;
import com.dream.technology.vo.ErrorCode;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Auther: Da Shuai
 * @Date: 2018/12/5 13:30
 * @Description:
 * @Company: zytech
 * @Email: 1043489207@qq.com
 */
@RestController
@RequestMapping("/risk/admin/dateType")
public class RcDateTypeController {

    private static final Logger logger = LoggerFactory.getLogger(RcDateTypeController.class);

    @Autowired
    private RcDateTypeService rcDateTypeService;

    /**
     * 数据列表查询
     * @param pageSize
     * @param pageNum
     * @return
     */
    @RequestMapping(value = "/list" ,method = RequestMethod.POST )
    public GenericRspDTO<Object> accountList(Integer pageSize, Integer pageNum ){

        logger.info("-----数据列表查询查询begin----");

        List<RcDateType> list = rcDateTypeService.findAll();

        logger.info("数据列表查询查询{}方法执行结束,出参={}","list", list.size());
        return GenericRspDTO.newInstance(ErrorCode.SUCCESS.getErrorCode(), ErrorCode.SUCCESS.getErrorMsg(), list);
    }

}
